package de.baumann.browser.api.net;


import java.util.List;

import de.baumann.browser.BuildConfig;
import de.baumann.browser.api.net.base.BaseUrl;
import de.baumann.browser.api.net.vo.HaseValueSet;
import de.baumann.browser.api.net.vo.HashFormat;
import de.baumann.browser.api.net.vo.LockStatus;
import de.baumann.browser.api.net.vo.LoginInfo;
import de.baumann.browser.api.net.vo.Notice;
import de.baumann.browser.api.net.vo.OdinOre;
import de.baumann.browser.api.net.vo.OdinWithdrawRecord;
import de.baumann.browser.api.net.vo.RechargeInfo;
import de.baumann.browser.api.net.vo.Result;
import de.baumann.browser.api.net.vo.Steal;
import de.baumann.browser.api.net.vo.Version;
import de.baumann.browser.api.net.vo.Weather;
import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

@BaseUrl(BuildConfig.API_URL)
public interface OtherApiService {

    /**
     * 获取 算力包规格
     *
     * @return
     */
    @POST("contribute/query_list")
    Observable<Result<List<HashFormat>>> getHashFormats();

    /**
     * 获取矿石
     *
     * @param lisence
     * @return
     */
    @FormUrlEncoded
    @POST("drip/get_drip")
    Observable<Result<List<OdinOre>>> getOdinOres(@Field("lisence") String lisence);

    /**
     * 收获矿石
     *
     * @param oreId
     * @return
     */
    @FormUrlEncoded
    @POST("drip/receive_drip")
    Observable<Result> gatherOre(@Field("id") String oreId);


    @FormUrlEncoded
    @POST("contribute/query_trans")
    Observable<Result<HaseValueSet>> getHashRecord( @Field("licence") String licence,
                                                   @Field("page_num") int pageNum,
                                                   @Field("page_size") int pageSize);


    @POST("withdrawal/queryWithdrawalList")
    Observable<Result<List<OdinWithdrawRecord>>> getWithdrawRecord();


    /**
     * 注册获取验证码
     *
     * @param phone 手机号
     * @return Result
     */
    @FormUrlEncoded
    @POST("sms/register/send")
    Observable<Result> registerGetSmsCode(@Field("phone") String phone,
                                          @Field("type") int type,
                                          @Field("vaptchaToken") String token,
                                          @Field("countryCode")int countryCode);

    @FormUrlEncoded
    @POST("sms/send")
    Observable<Result> getSmsCode(
            @Field("phone") String phone,
            @Field("countryCode")int countryCode,
            @Field("vaptchaToken") String token,
            @Field("type") int type);


    @POST("contribute/ranking")
    Observable<Result<List<LoginInfo>>> getHashRanking();


    @FormUrlEncoded
    @POST("withdrawal/minerWithdrawal")
    Observable<Result> withdraw(@Field("number") String amount,
                                @Field("type") int type,
                                @Field("countryCode")int countryCode,
                                @Field("code") String code);


    @POST("notice/gets")
    Observable<Result<List<Notice>>> getNotice();

    @FormUrlEncoded
    @POST("notice/read")
    Observable<Result> noticeRead(@Field("notice_id") String noticeId);


    @POST("app/gets")
    Observable<Result<RechargeInfo>> getRechargeAddress();

    @FormUrlEncoded
    @POST("weather/gets")
    Observable<Result<Weather>> getWeather(@Field("location") String location);

    @POST("drip/get_rich")
    Observable<Result<List<Steal>>> getCanStealList();

    @POST("drip/get_s_his")
    Observable<Result<List<Steal>>> getOftenStealList();

    @POST("drip/get_game_status")
    Observable<Result<LockStatus>> getGameStatus();

    @POST("drip/set_game_status")
    Observable<Result<LockStatus>> setGameStatus();

    @FormUrlEncoded
    @POST("account/feedback/create")
    Observable<Result> feedback(@Field("title") String title, @Field("content") String content);


    @POST("version/gets")
    Observable<Result<Version>> updateVersion();
}
